class PC{
    CPU cpu;
    HardDisk HD;
    public void setCPU(CPU c){
        this.cpu=c;
    }
    public void setHardDisk(HardDisk h){
        this.HD=h;
    }
    //显示CPU的速度和硬盘的容量
    public void show(){
        System.out.println("CPU速度："+cpu.getSpeed());
        System.out.println("硬盘容量"+HD.getAmount());
    }
}
class CPU{
    int speed;
    public void setSpeed(int m){
        this.speed=m;
    }
    public int getSpeed(){
        return this.speed;
    }
}
class HardDisk{
    int amount;
    public void setAmount(int m){
        this.amount=m;
    }
    public int getAmount(){
        return this.amount;
    }
}
public class Test {
    public static void main(String[] args) {
        CPU cpu=new CPU();
        cpu.setSpeed(2000);
        HardDisk disk=new HardDisk();
        disk.setAmount(200);

        PC pc=new PC();
        pc.setCPU(cpu);
        pc.setHardDisk(disk);
        pc.show();
    }
}
